
    public class Undergraduate extends student{
        public Undergraduate(String name){
            this.name = name;
        }

        @Override
        public void caculateGrade() {
            super.type = "本科生";
            int average;
            int sum = 0;
            for (int i = 0; i < courseNo; i++) {
                sum += courses[i];
            }
            average = sum/courseNo;
            if(average >= 80 && average <= 100)
                courseGrade = "优秀";
            else if(average >= 70 && average < 80)
                courseGrade = "良好";
            else if(average >= 60 && average < 70)
                courseGrade = "一般";
            else if(average >= 50 && average < 60)
                courseGrade = "及格";
            else if(average >= 0 && average < 50)
                courseGrade = "不及格";
        }
    }

